
#ifndef ROPUFU_PARTITION_HPP_INCLUDED
#define ROPUFU_PARTITION_HPP_INCLUDED

#include "matlab.hpp"

#include <cstddef>
#include <vector>

namespace ropufu
{
    struct partition : public std::vector<double>
    {
    private:
        bool m_is_linear;
        bool m_is_exponential;

        explicit partition(std::vector<double>&& nodes, bool is_linear, bool is_exponential)
            : std::vector<double>(nodes), m_is_linear(is_linear), m_is_exponential(is_exponential)
        {

        }

    public:
        static partition make_linear(double from, double to, std::size_t count_nodes)
        {
            return partition(matlab::linspace(from, to, count_nodes), true, from == to);
        }

        static partition make_exponential(double from, double to, std::size_t count_nodes)
        {
            return partition(matlab::expspace(from, to, count_nodes), from == to, true);
        }

        std::size_t count_intervals()
        {
            return this->size() - 1;
        }

        std::size_t count_nodess()
        {
            return this->size();
        }
    };
}

#endif // ROPUFU_PARTITION_HPP_INCLUDED
